#include <stdio.h>
#include "tc.h"
#include <math.h>
int main()
{   int x = 60, y = 15;
	float t = 0;
	char key = 'w';
	int end = 0;
 	gotoxy(x, y);
	printf("*");
	while (end != 1) 
	{

		key = getch();         //scanf("%c", &key);
		gotoxy(x, y);
		printf(" ");
		if (key == 'a')
		{
			x--;
		}
		if (key == 'd')
		{
			x++;
		}
		if (key == 'w')
		{
			y--;
		}
		if (key == 's')
		{
			y++;
		}

		if (key == 'x')
		{
			end = 1;
		}
		gotoxy(x, y);
	    printf("*");


		gotoxy(10,10);
		printf("x = %3d, y = %3d", x, y);

		if (x >= 119) 
		{
			x = 0;
		}
	}



	return 0;
}